- name: make the app be real
  hosts: os_control_stg:os_control
  user: root
  gather_facts: False

  vars_files:
    - /srv/web/infra/ansible/vars/global.yml
    - "/srv/private/ansible/vars.yml"
    - /srv/web/infra/ansible/vars/{{ ansible_distribution }}.yml

  roles:
  - role: openshift/project
    app: asknot
    description: What can I do for Fedora
    appowners:
    - zlopez

  - role: openshift/object
    app: asknot
    template: imagestream.yml
    objectname: imagestream.yml

  - role: openshift/object
    app: asknot
    template: buildconfig.yml
    objectname: buildconfig.yml

  - role: openshift/start-build
    app: asknot
    buildname: asknot-build
    objectname: asknot-build

  - role: openshift/object
    app: asknot
    file: service.yml
    objectname: service.yml

  - role: openshift/route
    app: asknot
    routename: asknot
    host: "stg.whatcanidoforfedora.org"
    serviceport: 8080-tcp
    servicename: asknot
    when: env == "staging"

  - role: openshift/route
    app: asknot
    routename: asknot
    host: "whatcanidoforfedora.org"
    serviceport: 8080-tcp
    servicename: asknot
    when: env == "production"

  - role: openshift/object
    app: asknot
    file: deploymentconfig.yml
    objectname: deploymentconfig.yml

  - role: openshift/rollout
    app: asknot
    dcname: asknot
